#include "cmsis_os2.h"
#include "lvgl.h"


extern osMutexId_t LvglMutexHandle;

void StartLvglTask(void *argument)
{
    osMutexAcquire(LvglMutexHandle, osWaitForever);

    const char* map[] = { "btn1","btn2","btn3", "" };
    lv_obj_t * btnm1 = lv_buttonmatrix_create(lv_scr_act());
    lv_buttonmatrix_set_map(btnm1, map);
    lv_buttonmatrix_set_button_width(btnm1, 2, 2);

    osMutexRelease(LvglMutexHandle);

    for(;;)
    {
        osMutexAcquire(LvglMutexHandle, osWaitForever);
        lv_timer_handler();
        osMutexRelease(LvglMutexHandle);
        osDelay(5);
    }
}
